#include <bits/stdc++.h>
using namespace std;
class mysingleton
{
    private:
    int data=0;
    mysingleton()=default;
    ~mysingleton()=default;
    public:
    static mysingleton & getinstance()
    {
        static mysingleton instance;
        return instance;
    }
    void inc()
    {
        data++;
    }
    void prt()
    {
        cout<<data<<"\n";
    }

};
int main()
{
mysingleton & a=mysingleton::getinstance();
mysingleton &b=mysingleton::getinstance();
b.prt();
for (int i=0;i<30;++i)
a.inc();
b.prt();
}